SQL Language For Beginners: Teach Yourself SQL (Programming courses Book 4) by Braharu Gabriel

SQL Language For Beginners: Teach Yourself SQL (Programming courses Book 4) by Braharu Gabriel

Author:Braharu, Gabriel [Braharu, Gabriel]
Language: eng
Format: azw3
Published: 2018-06-13T16:00:00+00:00


A. Display clientcode, lastname, firstname, locality for all clients that have unpaid invoices.

SELECT Clients.clientcode, Clients.lastname, Clients.firstname, Clients.locality

FROM (Clients INNER JOIN Invoices ON Clients.clientcode = Invoices.clientcode) INNER JOIN (Receipts INNER JOIN

InvoicesWithReceipts ON Receipts.receiptcode = InvoicesWithReceipts.receiptcode) ON Invoices.invoicecode = InvoicesWithReceipts.invoicecode

WHERE Receipts.amount<[totalwithvat] OR Invoices.invoicecode NOT IN (SELECT InvoicesWithReceipts.invoicecode FROM InvoicesWithReceipts)

An invoice shall be considered unpaid if need to be paid partly ([totalwithvat]>[amount]) or if it is not paid at all, that is not covered by any invoicecode in table InvoicesWithReceipts (NOT IN (SELECT InvoicesWithReceipts.invoicecode FROM InvoicesWithReceipts))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.